package com.jwell.panrank.contract

import com.jwell.cargoapp.ui.base.IBaseView
import com.jwell.driverapp.tools.BaseSubscriber
import com.jwell.panrank.entity.ValMsgDto
import com.jwell.panrank.model.PreRegisterModel

/**
 * Created by 76577 on 2018/4/9.
 * 预登记
 */
class PreRegisterContract {
    interface View : IBaseView {
        fun createSucceed()

        fun createFailed(msg: String)
        //验证车牌，根据状态提示
        fun showCheckCarNum(data: ValMsgDto, position: Int)

        //验证司机，根据状态提示
        fun showCheckDriverPhone(isNew: Boolean, phone: String, name: String?)


        //验证收发单位是否有权限
        fun havePermission(havePermission: Boolean)

    }

    interface Presenter {
        fun createWaybill(data: PreRegisterModel.RequestData)

        //验证车牌
        fun checkCarNum(id: String, position: Int)

        //验证司机
        fun checkDriverPhone(id: String, name: String?)

        //验证收发货单位
        fun checkUnit(forwardingUnit: String?, receivingUnit: String?)
    }

    interface Model {
        fun createWaybill(data: PreRegisterModel.RequestData, baseSubscriber: BaseSubscriber)

        //验证车牌
        fun checkCarNum(id: String, baseSubscriber: BaseSubscriber)

        //验证司机
        fun checkDriverPhone(id: String, baseSubscriber: BaseSubscriber)

        //验证收发货单位
        fun checkUnit(forwardingUnit: String?, receivingUnit: String?, baseSubscriber: BaseSubscriber)
    }
}